<script setup>
    import {ref} from "vue"
    const date = ref(new Date())

    // 间隔一秒钟打印一次
    const printDate = () => {
      setInterval(() => {
        date.value = new Date()
      }, 1000)
    }
    printDate()
</script>

<template>
  <div>
    <p>{{ date }}</p>
  </div>
</template>

<style scoped>

</style>